/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Tag;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author ajou
 */
@Stateless
public class QuestionEntityFacade extends AbstractFacade<QuestionEntity> {
    @PersistenceContext(unitName = "AjouConquerorServer-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }
    
     public QuestionEntity getquestion(int questionnum) {
          for (QuestionEntity p : findAll()) {
            if (p.getQuestNum() == questionnum) {
                 return p;
            }
        }
        return null;
     }
    

    public QuestionEntityFacade() {
        super(QuestionEntity.class);
    }
    
}
